Open Dental 12.1 with Mono on Linux

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
User avatar
Justin Shafer
Posts: 595
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Open Dental 12.1 with Mono on Linux

Post by Justin Shafer » Sat Feb 23, 2013 2:31 am

Here are the code changes I made.. Compiled in Visual Studio. Run in linux like so. mono ./OpenDental.exe or just use binfmt which is another subject.

Ran on Ubuntu 13.04 Alpha.. It WAS hanging on the splash screen. BreakPoints!!! Woot Woot!

http://www.onsitedentalsystems.com/OD12.1.tar.bz2 is the ENTIRE SOLUTION that can be loaded in MonoDevelop, it has all the changes, and the Compiled Version is in Debug. Used with MonoDevelop 3

Image
Image


***BE SURE TO REMOVE THE COMPUTER PREFERENCE FOR THIS COMPUTER YOUR TRYING TO USE, IF THE NAME IS ALREADY IN THE DATABASE.***
If you scroll to the right, you will see DIRECTX Settings for the Computer Preference. DIRECTX settings MUST BE BLANK, OR CHART WILL CRASH.

Image

My FreeDentalConfig.xml
<?xml version="1.0" encoding="utf-8"?>
<ConnectionSettings>
<DatabaseConnection>
<ComputerName>192.168.1.21</ComputerName>
<Database>opendental</Database>
<User>root</User>
<Password></Password>
<NoShowOnStartup>False</NoShowOnStartup>
</DatabaseConnection>
<DatabaseType>MySql</DatabaseType>
</ConnectionSettings>

=========================

FormOpenDental.cs Line 1566 in Open Dental
//if(ComputerPrefs.LocalComputer.DirectXFormat=="invalid") {
//No valid local DirectX format could be found.
//Simply revert to OpenGL.
ComputerPrefs.LocalComputer.GraphicsSimple=DrawingMode.Simple2D;
//}

ContrImages.cs Ln 172 in OpenDental
public ContrDocs(){
Logger.openlog.Log("Initializing Document Module...", Logger.Severity.INFO);
InitializeComponent();
//The context menu causes strange bugs in MONO when performing selections on the tree.
//Perhaps when MONO is more developed we can remove this check.
//Also, the SigPlusNet() object cannot be instantiated on 64-bit machines, because
//the code for instantiation exists in a 32-bit native dll. Therefore, we have put
//the creation code for the topaz box in CodeBase.TopazWrapper.GetTopaz() so that
//the native code does not exist or get called anywhere in the program unless we are running on a
//32-bit version of Windows.
//bool isUnix=CodeBase.ODEnvironment.IsUnixOperatingSystem();
//bool platformUnix=Environment.OSVersion.Platform==PlatformID.Unix;
//allowTopaz=(!platformUnix && !isUnix);
//if(platformUnix) {
//TreeDocuments.ContextMenu=null;
//}
//if(allowTopaz){//Windows OS
//try {
//sigBoxTopaz=CodeBase.TopazWrapper.GetTopaz();
//panelNote.Controls.Add(sigBoxTopaz);
//sigBoxTopaz.Location=sigBox.Location;//new System.Drawing.Point(437,15);
//sigBoxTopaz.Name="sigBoxTopaz";
//sigBoxTopaz.Size=new System.Drawing.Size(362,79);
//sigBoxTopaz.TabIndex=93;
//sigBoxTopaz.Text="sigPlusNET1";
//sigBoxTopaz.DoubleClick+=new System.EventHandler(this.sigBoxTopaz_DoubleClick);
//CodeBase.TopazWrapper.SetTopazState(sigBoxTopaz,0);
// }
//catch { }
//}
//We always capture with a Suni device for now.
//TODO: In the future use a device locator in the xImagingDeviceManager
//project to return the appropriate general device control.
xRayImageController=new SuniDeviceControl();
this.xRayImageController.OnCaptureReady+=new System.EventHandler(this.OnCaptureReady);
this.xRayImageController.OnCaptureComplete+=new System.EventHandler(this.OnCaptureComplete);
this.xRayImageController.OnCaptureFinalize+=new System.EventHandler(this.OnCaptureFinalize);
Logger.openlog.Log("Document Module initialization complete.", Logger.Severity.INFO);
}

ODEnviroment.cs Ln 10 inCodeBase
public static bool IsUnixOperatingSystem(){

ContrChart.cs Ln 264 in OpenDental
//private WebBrowser webBrowserEcw;

ContrChart.cs Ln 551 in OpenDental
//this.webBrowserEcw = new System.Windows.Forms.WebBrowser();

ContrChart.cs Ln 3055 in OpenDental
//this.panelEcw.Controls.Add(this.webBrowserEcw);

ContrChart.cs Ln 3077 in OpenDental
//this.webBrowserEcw.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top |

System.Windows.Forms.AnchorStyles.Bottom)
//| System.Windows.Forms.AnchorStyles.Left)
//| System.Windows.Forms.AnchorStyles.Right)));
//this.webBrowserEcw.Location = new System.Drawing.Point(1, 11);
//this.webBrowserEcw.MinimumSize = new System.Drawing.Size(20, 20);
//this.webBrowserEcw.Name = "webBrowserEcw";
//this.webBrowserEcw.Size = new System.Drawing.Size(370, 52);
//this.webBrowserEcw.TabIndex = 198;
//this.webBrowserEcw.Url = new System.Uri("", System.UriKind.Relative);

ContrChart.cs Ln 3438 in OpenDental
//webBrowserEcw.Url=null;

ContrChart.cs Ln 3568 in OpenDental
//webBrowserEcw.Url=null;

ContrChart.cs Ln 3604 in OpenDental
//webBrowserEcw.Url=null;

ContrChart.cs Ln 3623 in OpenDental
//webBrowserEcw.Navigate(path);

ContrChart.cs Ln 3628 in OpenDental
//webBrowserEcw.Url=null;


ContrChart.cs Ln 3765 in OpenDental
//webBrowserEcw.Url=new Uri("http://"+strAppServer+"/mobiledoc/jsp/dashboard/Overview.jsp?ptId="
//+PatCur.PatNum.ToString()+"&panelName=overview&pnencid="
//+Bridges.ECW.AptNum.ToString()+"&context=progressnotes&TrUserId="+Bridges.ECW.UserId.ToString());

ContrChart.cs Ln 3771 in OpenDental
//webBrowserEcw.Url=null;

ProgramEntry.cs Ln 38 in OpenDental
//Application.SetCompatibleTextRenderingDefault(false);
//designer uses new text rendering. This makes the exe use matching text rendering. Before this was added, it was common for labels to be longer in the running program than they were in the designer.
//Application.EnableVisualStyles();//changes appearance to XP
//Application.DoEvents();

Program.cs in UnitTests
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);

RdlDesigner.cs Ln 1284 in RDLDesign
//Application.EnableVisualStyles();
//Application.DoEvents(); // when Mono this goes into a loop
Program.cs Line 13 in DatabaseIntegrityCheck
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);

Program.cs Line 15 in OpenDentHL7
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);

Program.cs Line 13 in ServiceManager
//Application.EnableVisualStyles();

Program.cs Line 14 in UpdateFileCopier
//Application.EnableVisualStyles();

Program.cs Line 13 in TestToothChart
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
Program.cs Line 13 in Crud
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);

Program.cs Line 13 in TestCanada
//Application.EnableVisualStyles();

Program.cs Line 13 in WebCamOD
//Application.EnableVisualStyles();

Program.cs Line 13 in CentralManager
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);

FormOpenDental.cs Line 1566 in Open Dental
//if(ComputerPrefs.LocalComputer.DirectXFormat=="invalid") {
//No valid local DirectX format could be found.
//Simply revert to OpenGL.
ComputerPrefs.LocalComputer.GraphicsSimple=DrawingMode.Simple2D
//}




ContrChart.cs Line 3403 in OpenDental
//toothChart.PreferredPixelFormatNumber=ComputerPrefs.LocalComputer.PreferredPixelFormatNum;
//toothChart.DeviceFormat=new ToothChartDirectX.DirectXDeviceFormat(ComputerPrefs.LocalComputer.DirectXFormat);

ComputerPrefs.cs Line 33 OpenDentBusiness
computerPref.GraphicsSimple=DrawingMode.Simple2D;

FormOpenDental.cs Line 1386 OpenDental
//Version versionOd=Assembly.GetAssembly(typeof(FormOpenDental)).GetName().Version;
//Version versionObBus=Assembly.GetAssembly(typeof(Db)).GetName().Version;
//if(versionOd!=versionObBus) {
//MessageBox.Show("Mismatched program file versions. Please run the Open Dental setup file again on this computer.");//No MsgBox or Lan.g() here, because we don't want to access the database if there is a version conflict.
//Application.Exit();
//return;
//}

FormOpenDental.cs Line 1411 OpenDental
//if(CommandLineArgs.StartsWith("WebServiceUri=") && CommandLineArgs.Length>14) {
//webServiceUri=CommandLineArgs.Substring(14).Trim('"');
//}
//if(CommandLineArgs.StartsWith("WebServiceIsEcw=") && CommandLineArgs.Length>16) {
//if(CommandLineArgs.Substring(16).Trim('"')=="True") {
//webServiceIsEcw=YN.Yes;
//}
//else {
// webServiceIsEcw=YN.No;
//}
//}

FormOpenDental.cs Line 1440 OpenDental
//if(webServiceUri!=""){//a web service was specified
if(odUser!="" && odPassword!=""){//and both a username and password were specified
noShow=YN.Yes;
//}

Form OpenDenta.cs Line 1516 OpenDental (FIXES HANGING SPLASH SCREEN)
//RefreshLocalData(invalidTypes.ToArray());
//FillSignalButtons(null);

FormOpenDental.cs Line 1497 OpenDental (FIXES HANGING SPLASH SCREEN)
//if(Programs.UsingEcwTight()) {
//Splash.Dispose();//We don't show splash screen when bridging to eCW.
//}
//We no longer do this shotgun approach because it can slow the loading time.
//RefreshLocalData(InvalidType.AllLocal);

FormOpenDental.cs Line 1508 OpenDental (FIXES HANGING SPLASH SCREEN)
//if(Programs.UsingEcwTight()) {
//lightSignalGrid1.Visible=false;
//}
//else{
invalidTypes.Add(InvalidType.Signals);//so when mouse moves over light buttons, it won't crash
//}

To Compile on MonoDevelop instead:
FormReportsMore.cs Line 789 OpenDental
//WinDashboard win=new WinDashboard();
//win.Show();

Find and Replace all files
Before
<?xml version="1.0" encoding="utf-8"?>
After
<?xml version="1.0" encoding="UTF-8"?>

Remove OpenDentalBusiness from the Solution. Add a precompiled OpenDentalBusiness.dll file to the rest of the Projects.

Add a precompiled OpenDentalwpf.dll file to the OpenDental Project

Delete System.Deplyment as a Resource of OpenDental.

User avatar
Justin Shafer
Posts: 595
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: Open Dental 12.1 with Mono on Linux

Post by Justin Shafer » Mon Feb 25, 2013 11:08 pm

Image

User avatar
jsalmon
Posts: 1490
Joined: Tue Nov 30, 2010 1:33 pm
Contact:

Re: Open Dental 12.1 with Mono on Linux

Post by jsalmon » Tue Feb 26, 2013 12:16 am

That's exciting. When I get some more free time I might try helping out. My initial interest is getting OpenDentBusiness to compile instead of having to use the pre-compiled dll. That project is very handy to have and to make changes in. I have yet to work with mono, do you have an idea why it won't compile it? Or did you just do that to save time?
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
Justin Shafer
Posts: 595
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: Open Dental 12.1 with Mono on Linux

Post by Justin Shafer » Tue Feb 26, 2013 10:22 pm

Ahh yes.. that was to get around Mono not easily having System.Something.Media.Color.. Mono wants libgluzilla which is more or less dead. They replaced that with moonlight, which I chose to not compile. Just to get it working. I figured once that was working I could try again.. I just wanted to "get some place". As it had been 3 years since I had tried with the older mono, I didn't quite remember how I did it. An old post helped.

That would be cool. It's still buggy.. Not really usable for most doc's, more for geeks.. I bought a capacitive stylus to make it easer. Images crashes... At least on the tablet, don't remember the desktop. Desktop is running mono 3.0.3, tablet 2.10... Graphics seem better in the Chart in 3.0.3..

Should be easy (I think) to compile moonlight, unless it requires something called xulrunner which is a firefox library...

I do these things to make sure I still stay somewhat sharp on Linux. :D I gave it an icon in the Application, Other.. So it looks like it was really installed. :D

haha I like your quote.

User avatar
Justin Shafer
Posts: 595
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: Open Dental 12.1 with Mono on Linux

Post by Justin Shafer » Tue Feb 26, 2013 10:37 pm

Looking back I wonder if uncommenting this would help images.

//TreeDocuments.ContextMenu=null;

this OpenDentalImages folder does not contain patient images, if it had some for appointment pics, I bet it would crash as soon as it loads.. Or crash when you moved the mouse over the appointment...

User avatar
jsalmon
Posts: 1490
Joined: Tue Nov 30, 2010 1:33 pm
Contact:

Re: Open Dental 12.1 with Mono on Linux

Post by jsalmon » Tue Feb 26, 2013 11:41 pm

If the InfoBubbleDraw were to crash, I wouldn't expect it to crash at drawing the patient image based on the fact that the appointment module looks to have loaded just fine and it's utilizing a graphics library which is pretty much used to draw the entire schedule. The patient picture is our custom PicutreBox control (OpenDental.UI.PictureBox) which does nothing fancy. Heck, when the InfoBubble is drawn, the patient picture box is set to null and then it tries to load the patient image from the AtoZ folder into the Image variable which is surrounded with a try catch and if anything goes wrong it stays null which simply shows a gray box saying no patient picture found or something to that nature.

However, if it does cause a crash, a quick work around could be checking the "Appointment bubble popup disabled" check box in Setup > Modules > Appts tab.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
Justin Shafer
Posts: 595
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: Open Dental 12.1 with Mono on Linux

Post by Justin Shafer » Sun Jun 22, 2014 7:03 pm

The next project is a tough one:
HP Touchpad

Using Android GPU Drivers inside of Gnome with Mono and hardfloat with OD 13.X

By the time I figure it out OD will probably be on 14.

And that is WITH the foundation being available... Not that Mono could handle GLES..... I just want to.

User avatar
jsalmon
Posts: 1490
Joined: Tue Nov 30, 2010 1:33 pm
Contact:

Re: Open Dental 12.1 with Mono on Linux

Post by jsalmon » Mon Jun 23, 2014 9:24 am

I forgot to mention that I took a couple hours this weekend and tried to look into how hard it would be to get the 3D tooth chart working with mono. Needless to say it's going to be a pretty big pain. I ended up on this web site called Axiom that allows DirectX code in mono. Whatever I do it looks like I'll have to rewrite the whole dang thing which I don't know if I have the patience for. :cry:
http://axiomengine.sourceforge.net/wiki ... /Main_Page

One technology I found amazing was MoMA. It tells you everything about your application that it doesn't like so that you can go fix it ahead of time instead of trying to read ambiguous compile errors from the command line.
http://mono-project.com/MoMA
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

Post Reply